package cn.tedu.cn;
//测试多线程编程
public class Test3_Thread {
    public static void main(String[] args) throws InterruptedException {
        //1 创建对象
        Thread thread =  new Thread();
        //调用方法
        System.out.println(thread.getId());//获取线程的标识
        thread.setName("线程1");//设置线程名称
        System.out.println(thread.getName());//获取线程名称

        thread.run();//?
        thread.start();//使该线程开始执行
        thread.stop();
//        Thread.sleep(10000);//ms 让线程休眠10毫秒
//        static Thread currentThread()---获取当前正在执行的线程对象
        Thread now = Thread.currentThread();
        System.out.println(now.getName());
        System.out.println(now.getId());
    }
}
